import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/views/Home.vue';
import Page1 from '@/views/Page1.vue';
import Page2 from '@/views/Page2.vue';
import Layout from '@/layouts/Layout.vue'; // 引入 Layout 组件
const router = createRouter({
 
  history: createWebHashHistory(import.meta.env.BASE_URL),
 
  routes: [
 
    {
 
      path: '/hello',
 
      component: () => import('@/views/HelloWorldView.vue')
 
    },

    {
        path: '/student',
        name: 'student',
        component: () => import('@/views/StudentView.vue')
    },

    {
      path: '/main',
      name: 'layouts',
      component: () => import('@/layouts/Container.vue'),
      //redirect 访问/main时默认展示到/main/p1
       
      children : [
        {
          path: 'p1',
          component: () => import('@/views/minio/index.vue'),
        },
        {
          path: 'p2',
          component: () => import('@/layouts/P2View.vue'),
        },
        {
          path: 'p3',
          component: () => import('@/layouts/P3View.vue'),
        },

        {
          path: 'p1Detail',
          component: () => import('@/views/minio/Detail.vue'),
        },
        
      ]
  },
  {
    path: '/main2',
    name: 'student',
    component: () => import('@/layouts/Container2.vue')
},


    {
        path: '/',
        component: Layout, // 使用 Layout 作为基础布局
        children: [
            { path: '/page1', component: Page1 },
            { path: '/page2', component: Page2 }, // ... 更多路由配置
            // ... 更多子路由配置
        ],
    },

    // {
    //   path: '/404',
    //   name: '404',
    //   component: () => import('@/views/404.vue')
    // },

    {
      path: '/:catchAll(.*)',
      component: () => import('@/views/404.vue')
    },


    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue')
    },
    // ,

    // {
    //     path: '/menu',
    //     component: DefaultLayout
    //     // children: [
    //     //   // 这里添加具体的页面路由，它们将显示在默认布局的内容区域
    //     //   { path: '', redirect: '/dashboard' },
    //     //   { path: '/dashboard', component: () => import('@/views/Dashboard.vue') }
    //     //   // 其他页面...
    //     // ]
    //   }
    
 
  ]
 
})
 
export default router